import os
import pygame
import math

class Level(object):
    def __init__(self):
        self.eventList=[]
        self.music="notdone"
        self.musicTime=0

    def addEvent(self,nameE,timeE):
        anevent=TimedEvent(nameE,float(timeE)*1000.0)
        self.eventList.append(anevent)
    def check(self,time):
        for x in self.eventList:
            #print str(time)+" "+str(x.time)
            if x.Done==False and math.fabs(float(x.time)-float(time))<100:
                #print x.time 
                x.Done=True
                return x
        return TimedEvent("empty",0)


class TimedEvent(object):
    def __init__(self,nameE,timeE):
        self.name=nameE
        self.time=timeE
        self.Done=False
